<?php

    require('init.php');
    require('header.php');
    $employes = Employe::getEmployes();
    echo '<div id="gestion"  class= "container_12">';
    echo '<a class="grid_4 alpha" href="details_employe.php">
    .     <img alt="#" src="../img/ajouter.png" title="Ajouter" class="btn_ajouter" width="30"/>
          Ajouter un nouvel employé</a>';
    echo '</div>';
    echo    '<div class= "container_12">';
    echo    '<table class="grid_12" cellspacing="0">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>Civilité</th>
                        <th>Nom</th>
                        <th>E-mail</th>
                        <th>Profil</th>
                        <th>Actif</th>
                        <th>Gérer</th>
                    </tr>
                </thead>
                <tbody>';
     foreach($employes as $employe) {
        $classe = "employeActif";
        if($employe->getValide() == 0) {
            $classe = "employeInactif";
        }
        echo        '<tr class="'.$classe.'">
                        <td>
                            '.$employe->getId().'
                        </td>
                        <td>
                            '.$employe->getCivilite().'
                        </td>
                        <td>
                            '.$employe.'
                        </td>
                        <td>
                            '.$employe->getEmail().'
                        </td>
                        <td>
                            '.$employe->getProfil().'
                        </td>
                        <td>
                            '.$employe->getValide().'
                        </td>
                        <td>
                            <a href="details_employe.php?id='.$employe->getId().'">Gérer</a> 
                        </td>
                    </tr>';
    }
    echo        '</tbody>
            </table>';
?>
